package com.golxen.framework.user.dao.entity;


import com.golxen.framework.db.dao.AbstractDaoEntity;

import java.math.BigInteger;
import java.util.Objects;

public class UserInfo extends AbstractDaoEntity {
    /**
     * 用户编号
     */
    private long userId;
    /**
     * 注册时间
     */
    private long registerTime;
    /**
     * 最后一次登录的时间
     */
    private long lastLoginTime;
    /**
     * 昵称
     */
    private String nickName = "";

    public UserInfo() {
        super();
        registerTime = System.currentTimeMillis() / 1000;
    }



    public long getUserId() {
        return userId;
    }

    public void setUserId(long userId) {
        if(this.userId != userId) {
            this.userId = userId;
            setUpdateOption();
        }
    }



    public long getRegisterTime() {
        return registerTime;
    }

    public void setRegisterTime(long registerTime) {
        if (this.registerTime != registerTime) {
            this.registerTime = registerTime;
            setUpdateOption();
        }
    }


    public long getLastLoginTime() {
        return lastLoginTime;
    }

    public void setLastLoginTime(long lastLoginTime) {
        if (this.lastLoginTime != lastLoginTime) {
            this.lastLoginTime = lastLoginTime;
            setUpdateOption();
        }
    }


    public String getNickName() {
        return nickName;
    }

    public void setNickName(String nickName) {
        if(!Objects.equals(this.nickName, nickName)) {
            this.nickName = nickName;
            setUpdateOption();
        }
    }

}
